
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
import Index from '@/views/Index.vue'
import { baseurl } from '/application.js'

const routes = [
  {
    path: '/',
    name: 'Index',
    component:Index,
    redirect:'/home',
    children:[
      {
        path: 'home',
        name: 'home',
        component: () => import('@/views/Home.vue')
      },
      {
        path: '/produce/detail/:id',
        name: 'detail',
        component: () => import('@/views/produce/Detail.vue')
      },
      {
        path: '/produce/list',
        name: 'list',
        alias: '/produce',
        component: () => import('@/views/produce/List.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(baseurl),
  routes
})

export default router
